/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
/**
 * Autogenerated by Thrift Compiler (0.15.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.accumulo.core.dataImpl.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
public class TSummary implements org.apache.thrift.TBase<TSummary, TSummary._Fields>, java.io.Serializable, Cloneable, Comparable<TSummary> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSummary");

  private static final org.apache.thrift.protocol.TField SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("summary", org.apache.thrift.protocol.TType.MAP, (short)1);
  private static final org.apache.thrift.protocol.TField CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("config", org.apache.thrift.protocol.TType.STRUCT, (short)2);
  private static final org.apache.thrift.protocol.TField FILES_CONTAINING_FIELD_DESC = new org.apache.thrift.protocol.TField("filesContaining", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField FILES_EXCEEDING_FIELD_DESC = new org.apache.thrift.protocol.TField("filesExceeding", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField FILES_LARGE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesLarge", org.apache.thrift.protocol.TType.I64, (short)5);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSummaryStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSummaryTupleSchemeFactory();

  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.Long> summary; // required
  public @org.apache.thrift.annotation.Nullable TSummarizerConfiguration config; // required
  public long filesContaining; // required
  public long filesExceeding; // required
  public long filesLarge; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    SUMMARY((short)1, "summary"),
    CONFIG((short)2, "config"),
    FILES_CONTAINING((short)3, "filesContaining"),
    FILES_EXCEEDING((short)4, "filesExceeding"),
    FILES_LARGE((short)5, "filesLarge");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // SUMMARY
          return SUMMARY;
        case 2: // CONFIG
          return CONFIG;
        case 3: // FILES_CONTAINING
          return FILES_CONTAINING;
        case 4: // FILES_EXCEEDING
          return FILES_EXCEEDING;
        case 5: // FILES_LARGE
          return FILES_LARGE;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __FILESCONTAINING_ISSET_ID = 0;
  private static final int __FILESEXCEEDING_ISSET_ID = 1;
  private static final int __FILESLARGE_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("summary", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
    tmpMap.put(_Fields.CONFIG, new org.apache.thrift.meta_data.FieldMetaData("config", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSummarizerConfiguration.class)));
    tmpMap.put(_Fields.FILES_CONTAINING, new org.apache.thrift.meta_data.FieldMetaData("filesContaining", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.FILES_EXCEEDING, new org.apache.thrift.meta_data.FieldMetaData("filesExceeding", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.FILES_LARGE, new org.apache.thrift.meta_data.FieldMetaData("filesLarge", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSummary.class, metaDataMap);
  }

  public TSummary() {
  }

  public TSummary(
    java.util.Map<java.lang.String,java.lang.Long> summary,
    TSummarizerConfiguration config,
    long filesContaining,
    long filesExceeding,
    long filesLarge)
  {
    this();
    this.summary = summary;
    this.config = config;
    this.filesContaining = filesContaining;
    setFilesContainingIsSet(true);
    this.filesExceeding = filesExceeding;
    setFilesExceedingIsSet(true);
    this.filesLarge = filesLarge;
    setFilesLargeIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TSummary(TSummary other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetSummary()) {
      java.util.Map<java.lang.String,java.lang.Long> __this__summary = new java.util.HashMap<java.lang.String,java.lang.Long>(other.summary);
      this.summary = __this__summary;
    }
    if (other.isSetConfig()) {
      this.config = new TSummarizerConfiguration(other.config);
    }
    this.filesContaining = other.filesContaining;
    this.filesExceeding = other.filesExceeding;
    this.filesLarge = other.filesLarge;
  }

  public TSummary deepCopy() {
    return new TSummary(this);
  }

  @Override
  public void clear() {
    this.summary = null;
    this.config = null;
    setFilesContainingIsSet(false);
    this.filesContaining = 0;
    setFilesExceedingIsSet(false);
    this.filesExceeding = 0;
    setFilesLargeIsSet(false);
    this.filesLarge = 0;
  }

  public int getSummarySize() {
    return (this.summary == null) ? 0 : this.summary.size();
  }

  public void putToSummary(java.lang.String key, long val) {
    if (this.summary == null) {
      this.summary = new java.util.HashMap<java.lang.String,java.lang.Long>();
    }
    this.summary.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.Long> getSummary() {
    return this.summary;
  }

  public TSummary setSummary(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.Long> summary) {
    this.summary = summary;
    return this;
  }

  public void unsetSummary() {
    this.summary = null;
  }

  /** Returns true if field summary is set (has been assigned a value) and false otherwise */
  public boolean isSetSummary() {
    return this.summary != null;
  }

  public void setSummaryIsSet(boolean value) {
    if (!value) {
      this.summary = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TSummarizerConfiguration getConfig() {
    return this.config;
  }

  public TSummary setConfig(@org.apache.thrift.annotation.Nullable TSummarizerConfiguration config) {
    this.config = config;
    return this;
  }

  public void unsetConfig() {
    this.config = null;
  }

  /** Returns true if field config is set (has been assigned a value) and false otherwise */
  public boolean isSetConfig() {
    return this.config != null;
  }

  public void setConfigIsSet(boolean value) {
    if (!value) {
      this.config = null;
    }
  }

  public long getFilesContaining() {
    return this.filesContaining;
  }

  public TSummary setFilesContaining(long filesContaining) {
    this.filesContaining = filesContaining;
    setFilesContainingIsSet(true);
    return this;
  }

  public void unsetFilesContaining() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FILESCONTAINING_ISSET_ID);
  }

  /** Returns true if field filesContaining is set (has been assigned a value) and false otherwise */
  public boolean isSetFilesContaining() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FILESCONTAINING_ISSET_ID);
  }

  public void setFilesContainingIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FILESCONTAINING_ISSET_ID, value);
  }

  public long getFilesExceeding() {
    return this.filesExceeding;
  }

  public TSummary setFilesExceeding(long filesExceeding) {
    this.filesExceeding = filesExceeding;
    setFilesExceedingIsSet(true);
    return this;
  }

  public void unsetFilesExceeding() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FILESEXCEEDING_ISSET_ID);
  }

  /** Returns true if field filesExceeding is set (has been assigned a value) and false otherwise */
  public boolean isSetFilesExceeding() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FILESEXCEEDING_ISSET_ID);
  }

  public void setFilesExceedingIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FILESEXCEEDING_ISSET_ID, value);
  }

  public long getFilesLarge() {
    return this.filesLarge;
  }

  public TSummary setFilesLarge(long filesLarge) {
    this.filesLarge = filesLarge;
    setFilesLargeIsSet(true);
    return this;
  }

  public void unsetFilesLarge() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FILESLARGE_ISSET_ID);
  }

  /** Returns true if field filesLarge is set (has been assigned a value) and false otherwise */
  public boolean isSetFilesLarge() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FILESLARGE_ISSET_ID);
  }

  public void setFilesLargeIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FILESLARGE_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case SUMMARY:
      if (value == null) {
        unsetSummary();
      } else {
        setSummary((java.util.Map<java.lang.String,java.lang.Long>)value);
      }
      break;

    case CONFIG:
      if (value == null) {
        unsetConfig();
      } else {
        setConfig((TSummarizerConfiguration)value);
      }
      break;

    case FILES_CONTAINING:
      if (value == null) {
        unsetFilesContaining();
      } else {
        setFilesContaining((java.lang.Long)value);
      }
      break;

    case FILES_EXCEEDING:
      if (value == null) {
        unsetFilesExceeding();
      } else {
        setFilesExceeding((java.lang.Long)value);
      }
      break;

    case FILES_LARGE:
      if (value == null) {
        unsetFilesLarge();
      } else {
        setFilesLarge((java.lang.Long)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case SUMMARY:
      return getSummary();

    case CONFIG:
      return getConfig();

    case FILES_CONTAINING:
      return getFilesContaining();

    case FILES_EXCEEDING:
      return getFilesExceeding();

    case FILES_LARGE:
      return getFilesLarge();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case SUMMARY:
      return isSetSummary();
    case CONFIG:
      return isSetConfig();
    case FILES_CONTAINING:
      return isSetFilesContaining();
    case FILES_EXCEEDING:
      return isSetFilesExceeding();
    case FILES_LARGE:
      return isSetFilesLarge();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TSummary)
      return this.equals((TSummary)that);
    return false;
  }

  public boolean equals(TSummary that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_summary = true && this.isSetSummary();
    boolean that_present_summary = true && that.isSetSummary();
    if (this_present_summary || that_present_summary) {
      if (!(this_present_summary && that_present_summary))
        return false;
      if (!this.summary.equals(that.summary))
        return false;
    }

    boolean this_present_config = true && this.isSetConfig();
    boolean that_present_config = true && that.isSetConfig();
    if (this_present_config || that_present_config) {
      if (!(this_present_config && that_present_config))
        return false;
      if (!this.config.equals(that.config))
        return false;
    }

    boolean this_present_filesContaining = true;
    boolean that_present_filesContaining = true;
    if (this_present_filesContaining || that_present_filesContaining) {
      if (!(this_present_filesContaining && that_present_filesContaining))
        return false;
      if (this.filesContaining != that.filesContaining)
        return false;
    }

    boolean this_present_filesExceeding = true;
    boolean that_present_filesExceeding = true;
    if (this_present_filesExceeding || that_present_filesExceeding) {
      if (!(this_present_filesExceeding && that_present_filesExceeding))
        return false;
      if (this.filesExceeding != that.filesExceeding)
        return false;
    }

    boolean this_present_filesLarge = true;
    boolean that_present_filesLarge = true;
    if (this_present_filesLarge || that_present_filesLarge) {
      if (!(this_present_filesLarge && that_present_filesLarge))
        return false;
      if (this.filesLarge != that.filesLarge)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetSummary()) ? 131071 : 524287);
    if (isSetSummary())
      hashCode = hashCode * 8191 + summary.hashCode();

    hashCode = hashCode * 8191 + ((isSetConfig()) ? 131071 : 524287);
    if (isSetConfig())
      hashCode = hashCode * 8191 + config.hashCode();

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(filesContaining);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(filesExceeding);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(filesLarge);

    return hashCode;
  }

  @Override
  public int compareTo(TSummary other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetSummary(), other.isSetSummary());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSummary()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.summary, other.summary);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetConfig(), other.isSetConfig());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetConfig()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.config, other.config);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetFilesContaining(), other.isSetFilesContaining());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFilesContaining()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesContaining, other.filesContaining);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetFilesExceeding(), other.isSetFilesExceeding());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFilesExceeding()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesExceeding, other.filesExceeding);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetFilesLarge(), other.isSetFilesLarge());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFilesLarge()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesLarge, other.filesLarge);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TSummary(");
    boolean first = true;

    sb.append("summary:");
    if (this.summary == null) {
      sb.append("null");
    } else {
      sb.append(this.summary);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("config:");
    if (this.config == null) {
      sb.append("null");
    } else {
      sb.append(this.config);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("filesContaining:");
    sb.append(this.filesContaining);
    first = false;
    if (!first) sb.append(", ");
    sb.append("filesExceeding:");
    sb.append(this.filesExceeding);
    first = false;
    if (!first) sb.append(", ");
    sb.append("filesLarge:");
    sb.append(this.filesLarge);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (config != null) {
      config.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TSummaryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TSummaryStandardScheme getScheme() {
      return new TSummaryStandardScheme();
    }
  }

  private static class TSummaryStandardScheme extends org.apache.thrift.scheme.StandardScheme<TSummary> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TSummary struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // SUMMARY
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map104 = iprot.readMapBegin();
                struct.summary = new java.util.HashMap<java.lang.String,java.lang.Long>(2*_map104.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key105;
                long _val106;
                for (int _i107 = 0; _i107 < _map104.size; ++_i107)
                {
                  _key105 = iprot.readString();
                  _val106 = iprot.readI64();
                  struct.summary.put(_key105, _val106);
                }
                iprot.readMapEnd();
              }
              struct.setSummaryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CONFIG
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.config = new TSummarizerConfiguration();
              struct.config.read(iprot);
              struct.setConfigIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // FILES_CONTAINING
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.filesContaining = iprot.readI64();
              struct.setFilesContainingIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // FILES_EXCEEDING
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.filesExceeding = iprot.readI64();
              struct.setFilesExceedingIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // FILES_LARGE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.filesLarge = iprot.readI64();
              struct.setFilesLargeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TSummary struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.summary != null) {
        oprot.writeFieldBegin(SUMMARY_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.summary.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.Long> _iter108 : struct.summary.entrySet())
          {
            oprot.writeString(_iter108.getKey());
            oprot.writeI64(_iter108.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.config != null) {
        oprot.writeFieldBegin(CONFIG_FIELD_DESC);
        struct.config.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(FILES_CONTAINING_FIELD_DESC);
      oprot.writeI64(struct.filesContaining);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FILES_EXCEEDING_FIELD_DESC);
      oprot.writeI64(struct.filesExceeding);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FILES_LARGE_FIELD_DESC);
      oprot.writeI64(struct.filesLarge);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TSummaryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TSummaryTupleScheme getScheme() {
      return new TSummaryTupleScheme();
    }
  }

  private static class TSummaryTupleScheme extends org.apache.thrift.scheme.TupleScheme<TSummary> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TSummary struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetSummary()) {
        optionals.set(0);
      }
      if (struct.isSetConfig()) {
        optionals.set(1);
      }
      if (struct.isSetFilesContaining()) {
        optionals.set(2);
      }
      if (struct.isSetFilesExceeding()) {
        optionals.set(3);
      }
      if (struct.isSetFilesLarge()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetSummary()) {
        {
          oprot.writeI32(struct.summary.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.Long> _iter109 : struct.summary.entrySet())
          {
            oprot.writeString(_iter109.getKey());
            oprot.writeI64(_iter109.getValue());
          }
        }
      }
      if (struct.isSetConfig()) {
        struct.config.write(oprot);
      }
      if (struct.isSetFilesContaining()) {
        oprot.writeI64(struct.filesContaining);
      }
      if (struct.isSetFilesExceeding()) {
        oprot.writeI64(struct.filesExceeding);
      }
      if (struct.isSetFilesLarge()) {
        oprot.writeI64(struct.filesLarge);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TSummary struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TMap _map110 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64); 
          struct.summary = new java.util.HashMap<java.lang.String,java.lang.Long>(2*_map110.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key111;
          long _val112;
          for (int _i113 = 0; _i113 < _map110.size; ++_i113)
          {
            _key111 = iprot.readString();
            _val112 = iprot.readI64();
            struct.summary.put(_key111, _val112);
          }
        }
        struct.setSummaryIsSet(true);
      }
      if (incoming.get(1)) {
        struct.config = new TSummarizerConfiguration();
        struct.config.read(iprot);
        struct.setConfigIsSet(true);
      }
      if (incoming.get(2)) {
        struct.filesContaining = iprot.readI64();
        struct.setFilesContainingIsSet(true);
      }
      if (incoming.get(3)) {
        struct.filesExceeding = iprot.readI64();
        struct.setFilesExceedingIsSet(true);
      }
      if (incoming.get(4)) {
        struct.filesLarge = iprot.readI64();
        struct.setFilesLargeIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
  private static void unusedMethod() {}
}

